﻿using System.Data;
using System.Windows.Forms;

namespace DPLAB.IPAMS.IPAMSGui.Controler
{
    public partial class ctrlDisplay : ctrlBase
    {
        public ctrlDisplay()
        {
            InitializeComponent();
        }

        public void addTab(DataTableCollection tbList)
        {
            foreach (DataTable table in tbList)
            {
                var tab = new TabPage();
                var dg = new DataGrid();
                dg.Dock = DockStyle.Fill;
                dg.DataSource = table;
                tab.Controls.Add(dg);
                tab.Name = table.TableName;
                tab.Text = table.TableName;
                tabCtrl.TabPages.Add(tab);
            }
        }
    }
}